<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>xiarikui管理后台</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/Admin/css/unify.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="__PUBLIC__/images/favicon.ico" type="image/x-icon" />
    <script src="__PUBLIC__/js/jQuery-2.1.4.min.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/js/myFormValidate.js"></script>
    <script src="__PUBLIC__/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/layer/layer-min.js"></script>
    <script src="__PUBLIC__/js/myAjax.js"></script>
    <script type="text/javascript">
    function delfunc(obj) {
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: $(obj).attr('data-id')
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $(obj).parent().parent().remove();
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }

    //全选
    function selectAll(name, obj) {
        $('input[name*=' + name + ']').prop('checked', $(obj).checked);
    }

    function get_help(obj) {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: 0.3,
            area: ['90%', '90%'],
            content: $(obj).attr('data-url')
        });
    }

    function delAll(obj, name) {
        var a = [];
        $('input[name*=' + name + ']').each(function(i, o) {
            if ($(o).is(':checked')) {
                a.push($(o).val());
            }
        });
        if (a.length == 0) {
            layer.alert('请选择删除项', {
                icon: 2
            });
            return;
        }
        layer.confirm('确认删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.ajax({
                type: 'get',
                url: $(obj).attr('data-url'),
                data: {
                    act: 'del',
                    del_id: a
                },
                dataType: 'json',
                success: function(data) {
                    if (data == 1) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        $('input[name*=' + name + ']').each(function(i, o) {
                            if ($(o).is(':checked')) {
                                $(o).parent().parent().remove();
                            }
                        });
                    } else {
                        layer.msg(data, {
                            icon: 2,
                            time: 2000
                        });
                    }
                    layer.closeAll();
                }
            });
        }, function(index) {
            layer.close(index);
            return false;
        });
    }
    </script>
    <style type="text/css">
        .table > thead:first-child > tr:first-child > th{
            border-bottom: 0 none;
        } 
    </style>
</head>

<body>
